let hander = require('./hander');

let reqHander = {};
reqHander['/'] = hander.home;
reqHander['/part'] = hander.part;
reqHander['/api'] = hander.api;

function router(pathname, res, params) {
    if (typeof reqHander[pathname] === 'function') {
        reqHander[pathname](res, params);
    } else {
        hander.other(res);
    }
}

module.exports.router = router;
